Firmware in a user terminal can be updated via a wired or wireless network. For example of an update method via a wireless network, a Firmware-Over-The-Air (FOTA) service delivers an update package to a user terminal wirelessly. The update package includes a series of instructions that, when applied to the existing firmware, update firmware to a newer version. An update agent stored on a user terminal executes the instructions in the update package to modify the existing firmware and produce the updated version.
The firmware in a user terminal may consist of a read-write file system. When the update engine has finished modifying a file in the file system, it may appear as though the changes have been completed since the modified data can be read from the file. However, those changes may only exist in a file system cache and have not yet been flushed out to non-volatile memory, such as a FLASH memory because the file system cache is designed to improve performance by queuing up many changes and then periodically flushing them to a FLASH memory. The file system cache is implemented in Random Access Memory (RAM) and not in non-volatile, permanent storage. Any power failure during firmware update will invalidate all data in the cache, which can cause the user terminal to be inoperable.